package com;

import java.net.Inet4Address;
import java.net.InetAddress;
import java.net.UnknownHostException;

public class Test {
    public static void main(String[] args) throws UnknownHostException {
        InetAddress byName = InetAddress.getByName("127.0.0.1");
        System.out.println("网络名"+byName);

        InetAddress byName2 = InetAddress.getByName("www.baidu.com");
        System.out.println("网络名2"+byName2);
    }
}
